<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
        <script type="text/javascript">
function getXMLHttpRequest() {
    try { return new XMLHttpRequest(); } catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}
    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
    throw new Error("This browser does not support XMLHttpRequest.");
}

function sendDelete(url, confirmation, successUrl) {
    if (confirm(confirmation)) {
        var r = getXMLHttpRequest();
        r.open("DELETE", url, false);
        r.send();
        if (r.status < 200 || r.status > 299) {
            alert(r.responseText);
        } else {
            if (successUrl == null) {
                location.reload(true);
            } else {
                location.href = successUrl;
            }
        }
    }
}
        </script>
<div class="header" align="center"><table class="header"><tr class="header"><td class="header"><img class="header" src="${pageContext.request.contextPath}/Notepad_red.png"/></td><td class="header">&nbsp;MicroBlog</td></tr></table></div>
<div class="links">
    <c:choose>
        <c:when test="${empty pageContext.request.userPrincipal}">
            <a class="links" href="${httpContext.uriInfo.baseUri}">Log in</a>
            &nbsp; | &nbsp;
            <a class="links" href="${httpContext.uriInfo.baseUri}register">Register</a>
        </c:when>
        <c:otherwise>
            <c:set var="pathPrefix" value="${httpContext.uriInfo.baseUri}${pageContext.request.userPrincipal.name}/"/>
            <div class="right">
                <a class="links" href="${pathPrefix}applications/register">Register App</a>
            </div>
            <a class="links" href="${pathPrefix}statuses/">Statuses</a>
            &nbsp; | &nbsp;
            <a class="links" href="${pathPrefix}statuses/new">New Status</a>
            &nbsp; | &nbsp;
            <a class="links" id="logout" onclick="document.forms['logout'].submit()" href="javascript:{}">Log out</a> (Logged in as <i>${pageContext.request.userPrincipal.name}</i>)
            <form name="logout" action="${httpContext.uriInfo.baseUri}logout" method="post"></form>
        </c:otherwise>
    </c:choose>
</div>
<div class="body" align="center">
